package leetcode;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class NDF {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        String str=scan.next();
        String key=scan.next();
        String[] split1 = str.split("\\?");
        String[] split2 = split1[1].split("&");
        int length = split2.length;
        Map<String,String> map=new HashMap<>();
        for (int i = 0; i < length; i++) {
            String[] split = split2[i].split("=");
            map.put(split[0],(split[1]));
        }
        String s = map.get(key);
        System.out.println(s);


    }
}
